Skip to content

Add systemvmtemplate arm64 build support#9437

Merged
yadvr merged 11 commits intoapache:4.19from
shapeblue:add_systemvmtemplate_arm64_support
Jul 26, 2024
Merged

Add systemvmtemplate arm64 build support#9437
yadvr merged 11 commits intoapache:4.19from
shapeblue:add_systemvmtemplate_arm64_support

Conversation

@yadvr
Copy link
Member

@yadvr yadvr commented Jul 24, 2024

This add support for building arm64 systemvmtemplate, which is basically branch of https://github.com/StepBee/cloudstack/tree/add_systemvmtemplate_arm64_support and work by @StepBee

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

@yadvr yadvr force-pushed the add_systemvmtemplate_arm64_support branch from 0894822 to 400e1ee Compare July 24, 2024 04:46
@yadvr yadvr changed the base branch from main to 4.19 July 24, 2024 04:47
@yadvr yadvr closed this Jul 24, 2024
@yadvr yadvr reopened this Jul 24, 2024
@yadvr yadvr added this to the 4.19.2.0 milestone Jul 24, 2024
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@codecov
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.08%. Comparing base (54c8b71) to head (c6900cd).
Report is 1 commits behind head on 4.19.

Additional details and impacted files
@@             Coverage Diff             @@
##               4.19    #9437     +/-   ##
===========================================
  Coverage     15.07%   15.08%             
+ Complexity    11169    11168      -1     
===========================================
  Files          5405     5406      +1     
  Lines        472677   472699     +22     
  Branches      60049    57658   -2391     
===========================================
+ Hits          71269    71287     +18     
- Misses       393479   393483      +4     
  Partials       7929     7929             
Flag Coverage Δ
uitests 4.30% <ø> (+0.02%) ⬆️
unittests 15.79% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrijapanicsb
Copy link
Contributor

Nice!

yadvr added 2 commits July 24, 2024 10:46
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@StepBee
Copy link
Contributor

StepBee commented Jul 24, 2024

@rohityadavcloud Thanks for picking this one up!
Really great to see building arm64 systemvms is making it's way into cloudstack.

Please let me know in case i can support somehow.

@yadvr
Copy link
Member Author

yadvr commented Jul 24, 2024

Thanks for replying @StepBee I've posted a question above. I'm trying to have the Jenkins job used to x86 systemvmtemplate build also build for aarch64, where I'm getting this error:

10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Executing /usr/bin/qemu-system-aarch64: []string{"-netdev", "user,id=user.0,hostfwd=tcp::2680-:22", "-machine", "virt", "-cpu", "cortex-a72", "-pflash", "/usr/share/AAVMF/AAVMF_CODE.fd", "-boot", "strict=off", "-drive", "file=../dist/systemvmtemplate,if=virtio,cache=writeback,discard=ignore,format=qcow2", "-drive", "file=/var/lib/jenkins/.cache/packer/f625f9a7fa1737d7bc5cd5e20e9ca14107ead36b.iso,if=none,index=0,id=cdrom0,media=cdrom", "-name", "systemvmtemplate", "-m", "500M", "-smp", "1", "-monitor", "none", "-vnc", "127.0.0.1:95", "-device", "virtio-net,netdev=user.0", "-device", "virtio-scsi-pci,id=scsi0", "-device", "virtio-scsi-device", "-device", "scsi-cd,drive=cdrom0"}
10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Started Qemu. Pid: 125333
10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Qemu stderr: WARNING: Image format was not specified for '/usr/share/AAVMF/AAVMF_CODE.fd' and probing guessed raw.
10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Qemu stderr:          Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Qemu stderr:          Specify the 'raw' format explicitly to remove the restrictions.
10:56:47 2024/07/24 10:56:47 packer-builder-qemu plugin: Qemu stderr: qemu-system-aarch64: Initialization of device cfi.pflash01 failed: Could not reopen file: Permission denied
10:56:47 �[1;31m==> qemu: Error launching VM: Qemu failed to start.

Host in Ubuntu 20.04 x86_64 VM (same one used to build the x86-64 systemvmtemplates)

Any ideas?

@yadvr yadvr changed the title Add systemvmtemplate arm64 support Add systemvmtemplate arm64 build support Jul 24, 2024
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr yadvr requested a review from nvazquez July 24, 2024 10:29
@yadvr yadvr requested a review from StepBee July 24, 2024 10:50
@yadvr
Copy link
Member Author

yadvr commented Jul 24, 2024

Tested the build with Jenkins jobs; and seems to work:

Built x86 systemvmtemplate:
Screenshot 2024-07-24 at 4 15 14 PM

Built arm64 template:
Screenshot 2024-07-24 at 4 15 19 PM

Copy link
Contributor

@StepBee StepBee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me.
I tested the changes of @rohityadavcloud and had a successful systemvm build.

Copy link
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohityadavcloud

On Ubuntu 24.04 LTS and packer version v1.11.1

❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

❯ packer --version
Packer v1.11.1

  1. The build for x86_64 on x86_64 system is timing out

bash build.sh systemvmtemplate 4.19.1.0 x86_64.


==> qemu: Waiting for SSH to become available...
==> qemu: Timeout waiting for SSH.
==> qemu: Deleting output directory...
Build 'qemu' errored after 31 minutes 41 seconds: Timeout waiting for SSH.

==> Wait completed after 31 minutes 41 seconds

==> Some builds didn't complete successfully and had errors:
--> qemu: Timeout waiting for SSH.

==> Builds finished but no artifacts were created.

  1. No issue observed when building aarch64 tempaplate on x86_64 system

bash build.sh systemvmtemplate 4.19.1.0 aarch64

@yadvr
Copy link
Member Author

yadvr commented Jul 25, 2024

@kiranchavala there's some problem with the packer version; can you try v1.9.x or v1.8.x ? This works in a Jenkins job that runs on Ubuntu 20.04 with packer v1.9.5, job log attached:
x86-packer-build.txt

@yadvr yadvr requested a review from kiranchavala July 25, 2024 15:51
@kiranchavala
Copy link
Member

@kiranchavala there's some problem with the packer version; can you try v1.9.x or v1.8.x ? This works in a Jenkins job that runs on Ubuntu 20.04 with packer v1.9.5, job log attached: x86-packer-build.txt

Hi @rohityadavcloud tried with packer versions 1.8 and 1.9 on Ubuntu 24.04 , still build fails for

bash build.sh systemvmtemplate 4.19.1.0 x86_64.

There is no issue with ubuntu 22.04 and the recent packer version 1.11.1.

Its fine if we can document this

Copy link
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested on ubuntu 22.0.4 x86_64 and on raspberry pi 4 , packer version 1.11.1

The systemvmtemplate generated successfully

bash build.sh systemvmtemplate 4.19.1.0 x86_64
bash build.sh systemvmtemplate 4.19.1.0 aarch64

@yadvr yadvr merged commit f8385a4 into apache:4.19 Jul 26, 2024
@yadvr yadvr deleted the add_systemvmtemplate_arm64_support branch July 26, 2024 08:08
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 31, 2024
* Move and copy files to new filenames

* Adjust bash scripts to support arm64

* change preseed for arm64 to create EFI partition

* change packer template files to support arm64

* Correct preseed file name in x86_64 packer template

* fixes

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* try different machine cpu

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* don't accelerate KVM for different arch (arm64 vm on amd64 host)

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* fix building arm64 on x86

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* Update README.md

---------

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Co-authored-by: StepBee <stephan@bienek.org>
@weizhouapache
Copy link
Member

I rebuilt systemvm template today, got the following templates

[   ]	systemvmtemplate-4.20.0-x86_64-hyperv.vhd.zip	2024-08-06 07:26	476M	 
[   ]	systemvmtemplate-4.20.0-x86_64-kvm.qcow2.bz2	2024-08-06 07:26	509M	 
[   ]	systemvmtemplate-4.20.0-x86_64-ovm.raw.bz2	2024-08-06 07:26	417M	 
[   ]	systemvmtemplate-4.20.0-x86_64-vmware.ova	2024-08-06 07:26	533M	 
[   ]	systemvmtemplate-4.20.0-x86_64-xen.vhd.bz2	2024-08-06 07:26	417M	 

do we need to update URLs in engine/schema/pom.xml ?

$ git grep systemvmtemplate engine/schema/pom.xml
engine/schema/pom.xml:                                    templateList.add("systemvmtemplate-${csVersion}.${patch}-kvm")
engine/schema/pom.xml:                                    templateList.add("systemvmtemplate-${csVersion}.${patch}-vmware")
engine/schema/pom.xml:                                    templateList.add("systemvmtemplate-${csVersion}.${patch}-xen")
engine/schema/pom.xml:                                    templateList.add("systemvmtemplate-${csVersion}.${patch}-ovm")
engine/schema/pom.xml:                                    templateList.add("systemvmtemplate-${csVersion}.${patch}-hyperv")
engine/schema/pom.xml:                                    <url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-kvm.qcow2.bz2</url>
engine/schema/pom.xml:                                    <url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-vmware.ova</url>
engine/schema/pom.xml:                                    <url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-xen.vhd.bz2</url>
engine/schema/pom.xml:                                    <url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-ovm.raw.bz2</url>
engine/schema/pom.xml:                                    <url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-hyperv.vhd.zip</url>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants